<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['member.agreement.list']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
	
	<rich:dataTable id="data" var="agreement" value="#{memberAgreementMgmtBean.agreementList}" rows="20" width="99%" >
		<rich:column style="text-align:center;width:35%;" >
			<f:facet name="header">
				<h:outputText value="#{messages['agreement.no']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{agreement.agreetmentNo}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:35%;">
			<f:facet name="header">
				<h:outputText value="#{messages['membership']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{agreement.membership.name}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['view.point']}"></h:outputText>
			</f:facet>
			<t:commandButton value="#{messages['action']}" action="#{memberAgreementMgmtBean.navViewPointAction}" 
			actionListener="#{memberAgreementMgmtBean.navViewPointActionListener}" styleClass="button"></t:commandButton>
			<f:param value="#{agreement.agreementId}" id="agreementId"/>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['view.invoice']}"></h:outputText>
			</f:facet>
			<t:commandButton value="#{messages['action']}" styleClass="button" action="#{memberAgreementMgmtBean.navViewAgreementInvoiceAction}" 
			actionListener="#{memberAgreementMgmtBean.navViewAgreementInvoiceActionListener}"></t:commandButton>
			<f:param value="#{agreement.agreementId}" id="vagreementId"/>
		</rich:column>
	</rich:dataTable>
	
	<rich:spacer height="30"></rich:spacer>
	
	<rich:datascroller align="left"  for="data" maxPages="20" />
	
	<rich:spacer height="30"></rich:spacer>

	<t:panelGrid>
		<t:commandButton value="#{messages['add.agreement']}" styleClass="button" action="#{memberNewAgreementBean.navCreate}" immediate="true"></t:commandButton>
	</t:panelGrid>
	
</rich:panel>
